<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>

<script type="text/javascript" src="jquery-1.9.1.js"></script>

</head>
<body>

<div id="login_div"></div>

<p/>

<input id="get_but" type="button" value="get" /><span id="get_div"></span>

<p/>
<input id="post_but" type="button" value="post" /><span id="post_div"></span>

<p/>
<input id="xml_but" type="button" value="xml" /><span id="xml_div"></span>

<div></div>

<script type="text/javascript">
$(function(){
	var b = false;
	var login = function(){
		$.ajax({
			type:"POST",
			url:"http://localhost:8080/webservice/j_spring_security_check",
			data:{j_username:"ml",j_password:"ml"},
			dataType:"json",
			success:function(data){
				$("#login_div").text(data.o_status+"|"+data.o_retmsg+"|"+data.customer);
			}
		});
		b=true;
	}
	$("#get_but").click(function(){
		if(!b){login();}
		$.ajax({
			type:"GET",
			url:"http://localhost:8080/webservice/ws/im/find",
			data:{memberID:"111",clientID:"222"},
			dataType:"json",
			success:function(data){
				$("#get_div").text(data.o_status+"|"+data.o_retmsg+"|"+data.customer);
			}
		});
	});
	$("#post_but").click(function(){
		if(!b){login();}
		$.ajax({
			type:"POST",
			url:"http://localhost:8080/webservice/ws/im/create",
			data:{memberID:"111",clientID:"222"},
			dataType:"json",
			success:function(data){
				$("#post_div").text(data.o_status+"|"+data.o_retmsg+"|"+data.customer);
			}
		});
	});
	
	$("#xml_but").click(function(){
		var xmldata = '<?xml version="1.0" encoding="UTF-8"?><XmlBean><id>123123123</id><name>asdasdadads</name><addr>阿是打算打算的</addr><email>asdas@aasds</email></XmlBean>';
		$.ajax({
			type:"POST",
			url:"http://localhost:8080/webservice/ws/im/xml",
			data:xmldata,
			dataType:"json",
			success:function(data){
				$("#post_div").text(data.o_status+"|"+data.o_retmsg+"|"+data.customer);
			}
		});
	});
});
</script>


</body>
</html>